/**
 * http://deepliquid.com/blog/archives/98
 */

define(function(require) {

var Path = require('zrender/graphic/Path')

var LineArrow = Path.extend({
  type: 'arrow',

  shape: {
    x1: 0,
    y1: 0,
    x2: 10,
    y2: 10
  },

  style: {
    stroke: '#000',
    fill: 'none'
  },

  buildPath(ctx, shape) {
    let { x1, y1, x2, y2 } = shape
    let headlen = 8
    let angle = Math.atan2(y2 - y1, x2 - x1);

    ctx.moveTo(x1, y1)
    ctx.lineTo(x2, y2);
    // ctx.lineTo(x2 - headlen*Math.cos(angle-Math.PI/6), y2 -headlen*Math.sin(angle-Math.PI/6))
    // ctx.moveTo(x2, y2)
    // ctx.lineTo(
    //   x2 - headlen * Math.cos(angle+Math.PI/6),
    //   y2 - headlen * Math.sin(angle+Math.PI/6)
    // )
  }
})

return LineArrow
})